/*
 * drop_ball_client.cpp
 *
 *  Created on: Dec 21, 2012
 *      Author: michiel
 */

#include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>

#include "rp_states/DropBallAction.h"

typedef actionlib::SimpleActionClient<rp_states::DropBallAction> Client;

int main(int argc, char** argv) {
	ros::init(argc, argv, "drop_ball_client");

	Client client("drop_ball", true);
	client.waitForServer();

	rp_states::DropBallGoal goal;
	goal.drop_ball = true;
	client.sendGoal(goal);
	client.waitForResult(ros::Duration(5.0));

	if (client.getState() == actionlib::SimpleClientGoalState::SUCCEEDED) {
		ROS_INFO("Success!");
	} else {
		ROS_INFO("Failure!");
	}
	ROS_INFO("Current State: %s", client.getState().toString().c_str());

	return 0;
}



